<template>
    <basic-container>
        <TitleComponent mainTitle="团队概览" />
        <avue-crud :option="option" :table-loading="crudData.loading" :data="crudData.data" :page.sync="crudData.page"
            v-model="crudData.form" ref="crud" @on-load="onLoad">

            <!-- <template slot="menuLeft"><el-button type="danger" size="small" plain icon="el-icon-delete"
                    v-if="permission.user_delete" @click="handleDelete">删 除
                </el-button>
            </template> -->
        </avue-crud>
    </basic-container>
</template>

<script setup lang="ts" name="taskDetail">
import { reactive } from 'vue';
// import {getList} from "@/api/user/overview.js";
import TitleComponent from '@/components/title/index.vue';
import BasicContainer from '@/components/basic-container/main.vue';

let option: any = reactive({
    // expand: true, // 展开行
    // rowKey: 'id', // 使用 expand 属性时必须配置 rowKey 为行数据的主键，不能重复
    expandLevel: 3,
    expandRowKeys: [1],
    height: 'auto',
    calcHeight: 100,
    searchShow: true,
    searchMenuSpan: 6,
    tip: false,
    border: true,
    index: false,
    viewBtn: false,
    editBtn: false,
    delBtn: false,
    addBtn: false,
    gridBtn: false,
    dialogWidth: '40%',
    menuFixed: 'right',
    labelWidth: 130,
    menu: false,
    selection: true,
    searchLabelWidth: 110,
    indexLabel: '序号',
    saveBtnText: '确定',
    refreshBtn: true, // 刷新按钮
    columnBtn: false,
    searchShowBtn: false,
    indexWidth: 60,
    column: [
        {
            label: "账号",
            prop: "account",
            // search: true,
            span: 24,
        },
        {
            label: "编号",
            prop: "index",
            // search: true,
            // type:'upload', 
            sortable: true,
            span: 24,
        },
        {
            label: "直推",
            prop: "test",
            span: 24,
        },
        {
            label: "VIP等级",
            prop: "test1",
            span: 24,
        },
        {
            label: "首次升级时间",
            prop: "test2",
            span: 24,
        },
        {
            label: "Vip到期时间",
            prop: "test3",
            span: 24,
        },
        {
            label: "创建时间",
            prop: "test4",
            span: 24,
        },
    ]
})
let crudData: any = reactive({
    loadingSubmit: false,
    loadingSave: false,
    index_unit: [],
    loading: true,
    active: 1,
    page: {
        pageSize: 10,
        currentPage: 1,
    },
    filedArr: [],
    data: []
})


// const handleDelete = ()=> {
//     if (this.selectionList.length === 0) {
//         this.$message.warning("请选择至少一条数据");
//         return;
//     }
//     this.$confirm("确定将选择数据删除?", {
//         confirmButtonText: "确定",
//         cancelButtonText: "取消",
//         type: "warning"
//     })
//         .then(() => {
//             return remove(this.ids);
//         })
//         .then(() => {
//             this.onLoad(this.page);
//             this.$message({
//                 type: "success",
//                 message: "操作成功!"
//             });
//             this.$refs.crud.toggleSelection();
//         });
// },




const onLoad = () => {
    crudData.loading = false;
    crudData.data = [
        {
            id: '662303',
            // index: 'https://jumptra.vip/uploads/images/89feef87a9eaeaf77e7828d76bd925da.png',
            index: '662303',
            account: '4412345678',
            test: 0,
            test1: 'VIP3',
            test2: '2023-06-19 05:40:22',
            test3: '2024-06-18 05:48:04',
            test4: '2023-06-19 05:29:59',
            children: [
                {
                    id: '665303',
                    index: '662306',
                    account: '7890123',
                    test: 0,
                    test1: 'VIP3',
                    test2: '2023-06-19 05:40:22',
                    test3: '2024-06-18 05:48:04',
                    test4: '2023-06-19 05:29:59',
                    children: [
                        {
                            id: '667303',
                            index: '447099299613',
                            account: '7890123',
                            test: 0,
                            test1: 'VIP3',
                            test2: '2023-06-19 05:40:22',
                            test3: '2024-06-18 05:48:04',
                            test4: '2023-06-19 05:29:59',
                        },
                    ],
                },
            ],
        },
        {
            id: '662301',
            index: '88888888',
            account: '88888888',
            test: 0,
            test1: 'VIP4',
            test2: '2023-06-17 05:40:22',
            test3: '2024-06-12 05:48:04',
            test4: '2023-06-14 05:29:59',
        }
    ];
    crudData.page.total = crudData.data.length;

    // getList().then((res: any) => {
    //     console.log('getReviewLog--', res);
    //     const Data = res.data.data;
    //      crudData.page.total = Data.total;
    //     crudData.logData = Data;
    //     crudData.loading = false;
    // });
}
</script>

<style scoped lang="scss"></style>